<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>用户 | 博客系统文档</title>
    <meta name="description" content="黑龙江科技大学计算机系">
    
    
    <link rel="preload" href="/assets/css/0.styles.3486ac9a.css" as="style"><link rel="preload" href="/assets/js/app.8bfad8b3.js" as="script"><link rel="preload" href="/assets/js/9.fbf25754.js" as="script"><link rel="prefetch" href="/assets/js/10.a876fc82.js"><link rel="prefetch" href="/assets/js/2.a4fcc584.js"><link rel="prefetch" href="/assets/js/3.aa7bd5d5.js"><link rel="prefetch" href="/assets/js/4.8716395f.js"><link rel="prefetch" href="/assets/js/5.232512e7.js"><link rel="prefetch" href="/assets/js/6.3a2a97b2.js"><link rel="prefetch" href="/assets/js/7.0ff022c0.js"><link rel="prefetch" href="/assets/js/8.a687a2cd.js">
    <link rel="stylesheet" href="/assets/css/0.styles.3486ac9a.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">博客系统文档</span></a> <div class="links" style="max-width:nullpx;"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">首页</a></div><div class="nav-item"><a href="https://github.com/huoher" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Github
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><a href="http://usth.edu.cn/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  关于学校
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <div class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">首页</a></div><div class="nav-item"><a href="https://github.com/huoher" target="_blank" rel="noopener noreferrer" class="nav-link external">
  Github
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><a href="http://usth.edu.cn/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  关于学校
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav>  <ul class="sidebar-links"><li><div class="sidebar-group first"><p class="sidebar-heading"><span>介绍</span> <!----></p> <ul class="sidebar-group-items"><li><a href="/guide.html" class="sidebar-link">如何使用</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/guide.html#声明" class="sidebar-link">声明</a></li><li class="sidebar-sub-header"><a href="/guide.html#ip地址" class="sidebar-link">IP地址</a></li><li class="sidebar-sub-header"><a href="/guide.html#token" class="sidebar-link">token</a></li><li class="sidebar-sub-header"><a href="/guide.html#url" class="sidebar-link">URL</a></li></ul></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading open"><span>API列表</span> <!----></p> <ul class="sidebar-group-items"><li><a href="/user.html" class="active sidebar-link">用户</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/user.html#登录" class="sidebar-link">登录</a></li><li class="sidebar-sub-header"><a href="/user.html#根据用户名查找用户" class="sidebar-link">根据用户名查找用户</a></li><li class="sidebar-sub-header"><a href="/user.html#注册" class="sidebar-link">注册</a></li><li class="sidebar-sub-header"><a href="/user.html#获取全部用户列表" class="sidebar-link">获取全部用户列表</a></li><li class="sidebar-sub-header"><a href="/user.html#获取已登陆的用户信息" class="sidebar-link">获取已登陆的用户信息</a></li><li class="sidebar-sub-header"><a href="/user.html#更新我的用户信息" class="sidebar-link">更新我的用户信息</a></li></ul></li><li><a href="/article.html" class="sidebar-link">文章</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/article.html#获取全部文章" class="sidebar-link">获取全部文章</a></li><li class="sidebar-sub-header"><a href="/article.html#添加文章" class="sidebar-link">添加文章</a></li><li class="sidebar-sub-header"><a href="/article.html#删除文章" class="sidebar-link">删除文章</a></li><li class="sidebar-sub-header"><a href="/article.html#查询我写的文章" class="sidebar-link">查询我写的文章</a></li><li class="sidebar-sub-header"><a href="/article.html#查询某个类型的文章" class="sidebar-link">查询某个类型的文章</a></li></ul></li><li><a href="/comment.html" class="sidebar-link">评论</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/comment.html#待定" class="sidebar-link">待定</a></li></ul></li></ul></div></li><li><div class="sidebar-group"><p class="sidebar-heading"><span>关于</span> <!----></p> <ul class="sidebar-group-items"><li><a href="/about.html" class="sidebar-link">关于我们</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/about.html#团队成员" class="sidebar-link">团队成员</a></li><li class="sidebar-sub-header"><a href="/about.html#关于班级" class="sidebar-link">关于班级</a></li><li class="sidebar-sub-header"><a href="/about.html#关于学校" class="sidebar-link">关于学校</a></li></ul></li></ul></div></li></ul> </div> <div class="page"> <div class="content"><h1 id="用户"><a href="#用户" aria-hidden="true" class="header-anchor">#</a> 用户</h1> <h2 id="登录"><a href="#登录" aria-hidden="true" class="header-anchor">#</a> 登录</h2> <ul><li>POST</li></ul> <div class="language- extra-class"><pre class="language-text"><code>/login
</code></pre></div><ul><li>请求</li></ul> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
	<span class="token property">&quot;username&quot;</span><span class="token operator">:</span> <span class="token string">&quot;a&quot;</span><span class="token punctuation">,</span>
	<span class="token property">&quot;password&quot;</span><span class="token operator">:</span> <span class="token string">&quot;a&quot;</span>
<span class="token punctuation">}</span>
</code></pre></div><ul><li>登录成功响应</li></ul> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token number">200</span><span class="token punctuation">,</span>
    <span class="token property">&quot;msg&quot;</span><span class="token operator">:</span> <span class="token string">&quot;登陆成功&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;data&quot;</span><span class="token operator">:</span> <span class="token string">&quot;eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1NTU2ODMzOTYsInVzZXJuYW1lIjoiaHVvaGVyIn0.xNsAevE-O22p--jq-JOsONEM1tC6RO8J1UXpNAVIvQ8&quot;</span>
<span class="token punctuation">}</span>
</code></pre></div><ul><li>登录失败响应</li></ul> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token number">401</span><span class="token punctuation">,</span>
    <span class="token property">&quot;msg&quot;</span><span class="token operator">:</span> <span class="token string">&quot;用户名或密码错误&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;data&quot;</span><span class="token operator">:</span> <span class="token null keyword">null</span>
<span class="token punctuation">}</span>
</code></pre></div><p>请求成功，则data内容为token，请在接下来该用户的请求中在Headers中携带，时效长期有效。</p> <p><strong>Headers的请求头</strong></p> <table><thead><tr><th>键</th> <th>值</th></tr></thead> <tbody><tr><td>Authorization</td> <td>eyJ0eXAiOiJhbGciOiJIUzI1NiJ</td></tr></tbody></table> <h2 id="根据用户名查找用户"><a href="#根据用户名查找用户" aria-hidden="true" class="header-anchor">#</a> 根据用户名查找用户</h2> <ul><li><p>GET</p></li> <li><p>URL</p></li></ul> <div class="language- extra-class"><pre class="language-text"><code>/veryuser?username=huoher
</code></pre></div><ul><li>找到了返回</li></ul> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token number">200</span><span class="token punctuation">,</span>
    <span class="token property">&quot;msg&quot;</span><span class="token operator">:</span> <span class="token string">&quot;找到&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;data&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token number">20</span><span class="token punctuation">,</span>
        <span class="token property">&quot;username&quot;</span><span class="token operator">:</span> <span class="token string">&quot;a&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;password&quot;</span><span class="token operator">:</span> <span class="token string">&quot;a&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;nickname&quot;</span><span class="token operator">:</span> <span class="token string">&quot;测试&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;register_time&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2019-04-25 13:30:57&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;email&quot;</span><span class="token operator">:</span> <span class="token string">&quot;a@126.com&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;city&quot;</span><span class="token operator">:</span> <span class="token string">&quot;黑龙江哈尔滨&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;phone&quot;</span><span class="token operator">:</span> <span class="token string">&quot;18977656732&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;role_name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;user&quot;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><ul><li>没找到返回</li></ul> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token number">200</span><span class="token punctuation">,</span>
    <span class="token property">&quot;msg&quot;</span><span class="token operator">:</span> <span class="token string">&quot;未找到&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;data&quot;</span><span class="token operator">:</span> <span class="token null keyword">null</span>
<span class="token punctuation">}</span>
</code></pre></div><p>请根据<strong>data</strong>是否为<strong>null</strong>判断是否找到了</p> <h2 id="注册"><a href="#注册" aria-hidden="true" class="header-anchor">#</a> 注册</h2> <p>注册前请首先检测用户名(username是否重复！！)</p> <div class="language- extra-class"><pre class="language-text"><code>/register
</code></pre></div><ul><li>POST</li></ul> <p>请求</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;username&quot;</span><span class="token operator">:</span> <span class="token string">&quot;whp&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;password&quot;</span><span class="token operator">:</span> <span class="token string">&quot;123456&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;nickname&quot;</span><span class="token operator">:</span> <span class="token string">&quot;大鸟&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;email&quot;</span><span class="token operator">:</span> <span class="token string">&quot;666@qq.com&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;city&quot;</span><span class="token operator">:</span> <span class="token string">&quot;天津&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;phone&quot;</span><span class="token operator">:</span> <span class="token string">&quot;18078675645&quot;</span>
<span class="token punctuation">}</span>
</code></pre></div><p><code>username</code> 用户名，不允许重复，登录用这个</p> <p><code>nickname</code> 为用户的昵称，不做要求</p> <p>username，password，nickname不能是空值，其余随意</p> <ul><li>返回</li></ul> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token number">200</span><span class="token punctuation">,</span>
    <span class="token property">&quot;msg&quot;</span><span class="token operator">:</span> <span class="token string">&quot;注册成功,请登陆&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;data&quot;</span><span class="token operator">:</span> <span class="token null keyword">null</span>
<span class="token punctuation">}</span>
</code></pre></div><p>注册失败返回</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token number">402</span><span class="token punctuation">,</span>
    <span class="token property">&quot;msg&quot;</span><span class="token operator">:</span> <span class="token string">&quot;用户名已经存在&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;data&quot;</span><span class="token operator">:</span> <span class="token null keyword">null</span>
<span class="token punctuation">}</span>
</code></pre></div><p>role为用户的角色，默认为user(普通用户)，管理员为admin</p> <p><strong>用户密码无需加密</strong>，<s>由后端加密</s>，本项目不加密</p> <h2 id="获取全部用户列表"><a href="#获取全部用户列表" aria-hidden="true" class="header-anchor">#</a> 获取全部用户列表</h2> <div class="language- extra-class"><pre class="language-text"><code>/getalluser
</code></pre></div><ul><li><p>需要token</p></li> <li><p>GET</p></li> <li><p>返回</p></li></ul> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token number">200</span><span class="token punctuation">,</span>
    <span class="token property">&quot;msg&quot;</span><span class="token operator">:</span> <span class="token string">&quot;查询成功&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;data&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token punctuation">{</span>
            <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token number">12</span><span class="token punctuation">,</span>
            <span class="token property">&quot;username&quot;</span><span class="token operator">:</span> <span class="token string">&quot;huoher&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;password&quot;</span><span class="token operator">:</span> <span class="token string">&quot;123456789&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;nickname&quot;</span><span class="token operator">:</span> <span class="token string">&quot;张秋池123&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;register_time&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2019-04-14 12:23:23&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;email&quot;</span><span class="token operator">:</span> <span class="token string">&quot;666@qq.com&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;city&quot;</span><span class="token operator">:</span> <span class="token string">&quot;天津&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;phone&quot;</span><span class="token operator">:</span> <span class="token string">&quot;18078675645&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;role_name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;user&quot;</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token punctuation">{</span>
            <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token number">17</span><span class="token punctuation">,</span>
            <span class="token property">&quot;username&quot;</span><span class="token operator">:</span> <span class="token string">&quot;whp&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;password&quot;</span><span class="token operator">:</span> <span class="token string">&quot;123456&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;nickname&quot;</span><span class="token operator">:</span> <span class="token string">&quot;大鸟&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;register_time&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2019-04-23 22:46:40&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;email&quot;</span><span class="token operator">:</span> <span class="token string">&quot;666@qq.com&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;city&quot;</span><span class="token operator">:</span> <span class="token string">&quot;天津&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;phone&quot;</span><span class="token operator">:</span> <span class="token string">&quot;18078675645&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;role_name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;user&quot;</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token punctuation">{</span>
            <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token number">18</span><span class="token punctuation">,</span>
            <span class="token property">&quot;username&quot;</span><span class="token operator">:</span> <span class="token string">&quot;ldh&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;password&quot;</span><span class="token operator">:</span> <span class="token string">&quot;123456&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;nickname&quot;</span><span class="token operator">:</span> <span class="token string">&quot;刘德华&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;register_time&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2019-04-23 22:47:15&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;email&quot;</span><span class="token operator">:</span> <span class="token string">&quot;666@qq.com&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;city&quot;</span><span class="token operator">:</span> <span class="token string">&quot;香港&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;phone&quot;</span><span class="token operator">:</span> <span class="token string">&quot;18078675645&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;role_name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;user&quot;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre></div><p>nickname 为昵称，没有更多的限制</p> <h2 id="获取已登陆的用户信息"><a href="#获取已登陆的用户信息" aria-hidden="true" class="header-anchor">#</a> 获取已登陆的用户信息</h2> <blockquote><p>不需要告诉后端你是谁，token里能读出来的</p></blockquote> <blockquote><p>用于已经登录的用户点击头像查看自己的详情</p></blockquote> <ul><li><p>需要token</p></li> <li><p>GET</p></li> <li><p>URL</p></li></ul> <div class="language- extra-class"><pre class="language-text"><code>/getuser
</code></pre></div><div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token number">200</span><span class="token punctuation">,</span>
    <span class="token property">&quot;msg&quot;</span><span class="token operator">:</span> <span class="token string">&quot;成功&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;data&quot;</span><span class="token operator">:</span> <span class="token punctuation">{</span>
        <span class="token property">&quot;id&quot;</span><span class="token operator">:</span> <span class="token number">16</span><span class="token punctuation">,</span>
        <span class="token property">&quot;username&quot;</span><span class="token operator">:</span> <span class="token string">&quot;whp&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;password&quot;</span><span class="token operator">:</span> <span class="token string">&quot;123456&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;nickname&quot;</span><span class="token operator">:</span> <span class="token string">&quot;大鸟&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;register_time&quot;</span><span class="token operator">:</span> <span class="token string">&quot;2019-04-22 23:31:33&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;email&quot;</span><span class="token operator">:</span> <span class="token string">&quot;666@qq.com&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;city&quot;</span><span class="token operator">:</span> <span class="token string">&quot;天津&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;phone&quot;</span><span class="token operator">:</span> <span class="token string">&quot;18078675645&quot;</span><span class="token punctuation">,</span>
        <span class="token property">&quot;role_name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;user&quot;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="更新我的用户信息"><a href="#更新我的用户信息" aria-hidden="true" class="header-anchor">#</a> 更新我的用户信息</h2> <blockquote><ul><li>为了方便，username不可更改，就像微信号不可更改</li></ul></blockquote> <blockquote><ul><li>user只能改自己的，admin可以改所有人的</li></ul></blockquote> <p>修改密码后，token会变化。</p> <p>如果密码修改，必须重新登录！</p> <ul><li>url</li></ul> <div class="language- extra-class"><pre class="language-text"><code>/updateuser
</code></pre></div><ul><li><p>必须有Token</p></li> <li><p>请求</p></li></ul> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;password&quot;</span><span class="token operator">:</span> <span class="token string">&quot;123456789&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;nickname&quot;</span><span class="token operator">:</span> <span class="token string">&quot;张秋池123&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;email&quot;</span><span class="token operator">:</span> <span class="token string">&quot;666@qq.com&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;city&quot;</span><span class="token operator">:</span> <span class="token string">&quot;天津&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;phone&quot;</span><span class="token operator">:</span> <span class="token string">&quot;18078675645&quot;</span>
<span class="token punctuation">}</span>
</code></pre></div><p>只需要传回需要修改的，不需要修改的可以传也可以不传</p> <p><strong>注意</strong>： <code>username</code>一旦注册，不能修改</p> <ul><li>返回</li></ul> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;code&quot;</span><span class="token operator">:</span> <span class="token number">200</span><span class="token punctuation">,</span>
    <span class="token property">&quot;msg&quot;</span><span class="token operator">:</span> <span class="token string">&quot;修改成功&quot;</span><span class="token punctuation">,</span>
    <span class="token property">&quot;data&quot;</span><span class="token operator">:</span> <span class="token null keyword">null</span>
<span class="token punctuation">}</span>
</code></pre></div><p>如果密码修改，必须重新登录！重新使用登录接口！</p> <ul><li>删除用户</li></ul></div> <div class="page-edit"><!----> <!----></div> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/guide.html" class="prev">
          如何使用
        </a></span> <span class="next"><a href="/article.html">
          文章
        </a>
        →
      </span></p></div> </div> <!----></div></div>
    <script src="/assets/js/app.8bfad8b3.js" defer></script><script src="/assets/js/9.fbf25754.js" defer></script>
  </body>
</html>
